import request from '@/router/axios';
import serviceList from '@/config/serviceList'
import {baseURL} from '@/api/common';

const {kwRobot,system} = serviceList;
//aicos-robot/model/list 获取模型列表
export const modelList = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/model/list`,
    method: 'post',
    data,
  })
}

// /aicos-robot/model/saveOrUpdate 新增或编辑模型
export const modelSaveOrUpdate = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/model/saveOrUpdate`,
    method: 'post',
    data
  })
}

// /aicos-robot/model/delete 删除模型
export const modelDelete = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/model/delete`,
    method: 'post',
    data
  })
}

//获取提示词工程列表
// /aicos-robot/modelPrompt/list
export const modelPromptList = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelPrompt/list`,
    method: 'post',
    data
  })
}

//新增或编辑提示词
// /aicos-robot/modelPrompt/saveOrUpdate
export const modelPromptSaveOrUpdate = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelPrompt/saveOrUpdate`,
    method: 'post',
    data
  })
}

//删除提示词工程
// /aicos-robot/modelPrompt/delete
export const modelPromptDelete = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelPrompt/delete`,
    method: 'post',
    data
  })
}

//复制提示词工程
// /aicos-robot/modelPrompt/copy
export const modelPromptCopy = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelPrompt/copy`,
    method: 'post',
    data
  })
}

//获取大模型功能配置
// /aicos-robot/modelSetting/list
export const modelSettingList = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSetting/list`,
    method: 'post',
    data
  })
}

//保存大模型的配置
// /aicos-robot/modelSetting/save
export const modelSettingSave = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSetting/save`,
    method: 'post',
    data
  })
}
//启用或停用配置
// /aicos-robot/modelSetting/stopOrStart
export const modelSettingStopOrStart = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSetting/stopOrStart`,
    method: 'post',
    data
  })
}

//查询配置是否有开启
// /aicos-robot/modelSetting/getSetting
export const modelSettingGetSetting = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSetting/getSetting`,
    method: 'post',
    data
  })
}

//首次问答
// aicos-robot/modelSetting/firstChat
export const modelSettingFirstChat = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSetting/firstChat`,
    method: 'post',
    data
  })
}
// 根据配置问答
// /aicos-robot/modelSetting/chat
export const modelSettingChat = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSetting/chat`,
    method: 'post',
    data
  })
}

//获取相应的大模型功能是否开启
// /modelSetting/getSetting
export const getSetting = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSetting/getSetting`,
    method: 'post',
    data
  })
}

// 获取安全校验
export const getModelSecurity = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSecurity/get`,
    method: 'post',
    data
  })
}

// 保存安全校验
export const saveModelSecurity = (data) => {
  return request({
    url: `${baseURL}api/${kwRobot}/modelSecurity/save`,
    method: 'post',
    data
  })
}

// 获取当前租户下的租户信息
export const getTenantInfoUrl = (data) => {
  // /aicc-system/baseTenantParam/getByTenantId
  return request({
    url: `${baseURL}api/${system}/baseTenantParam/getByTenantId`,
    method: 'post',
    data
  });
}
